﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace PuanYonetimi
{
    public partial class frmPuanListe : XtraForm
    {
        public frmPuanListe()
        {
            InitializeComponent();
        }

        private void frmPuanListe_Load(object sender, EventArgs e)
        {
            using (PromoEntities ent = new PromoEntities())
            {
                gridControl1.DataSource = (from c in ent.Cariler
                                           join p in ent.BonusPuanlar on c.Kodu equals p.Cari_Kod
                                           where p.Puan > 0
                                           select new { Kodu = c.Kodu, Unvani = c.Adi, Puan = p.Puan, AlisverisTutari = p.ToplamTutar }).ToList();
                gridView1.BestFitColumns();
            }
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
